# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-rspec-mocks
_gemname=${pkgname#ruby-}
pkgver=3.13.0
pkgrel=0
pkgdesc="RSpec's 'test double' framework, with support for stubbing and mocking"
url="https://relishapp.com/rspec/rspec-mocks/"
arch="noarch"
license="MIT"
depends="ruby ruby-diff-lcs ruby-rspec-support~=${pkgver%.*}"
options="!check"  # rspec's tests are written in rspec
source="$pkgname-$pkgver.tar.gz::https://github.com/rspec/$_gemname/archive/v$pkgver.tar.gz
	gemspec.patch"
builddir="$srcdir/$_gemname-$pkgver"

build() {
	gem build $_gemname.gemspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Clean-up...
	rm -r "$gemdir"/cache \
		"$gemdir"/build_info \
		"$gemdir"/doc
}

sha512sums="
5d7f52ac3594b37a87d377fcd2300fa1811490fff392ed0bbb4a6de471ae5cc627a7f9e7e7c351031558b87f78e3fcc2fff77ba2fffbb838972a9eb28b6c53da  ruby-rspec-mocks-3.13.0.tar.gz
6fd7ab08b20a93f806a8d3c42da5da0a99162793079ecb1695341a04dff2a7cefdb12592d1798fb844dfbdf8ead6ad0b8729e461d3cd5af46d853b182d15228d  gemspec.patch
"
